package com.example.frickytest;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;

public class myActivity extends Activity implements OnClickListener {
	private Button btn;

	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.VERTICAL);
		btn = new Button(this);
		btn.setId(101);
		btn.setText("exit");
		btn.setOnClickListener(this);
		LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(135, 50);
		param.topMargin = 10;
		layout.addView(btn, param);
		setContentView(layout);
		// -----------------------------------------
		Thread.currentThread().setName(
				Thread.currentThread().getName() + "-myActivity");
		setTitle(Thread.currentThread().getName());
	}

	public void onClick(View v) {
		switch (v.getId()) {
		case 101:
			finish();
			break;
		}
	}
}